<template>
    <div>
        <table>
            <tr>
                <td>编号</td>
                <td>图书名称</td>
                <td>作者</td>
            </tr>
            <tr v-for="item in books">
                <td>{{item.id}}</td>
                <td>{{item.name}}</td>
                <td>{{item.author}}</td>

            </tr>
        </table>
    </div>
    
</template>

<script>
    export default {
        name: "Book",
        data(){
            return {
                msg:'hello vue',
                books:[
                    {
                        id:1,
                        name:'java零基础',
                        author:'涛'
                    },
                    {
                        id:2,
                        name:'Vue零基础',
                        author:'aa涛'
                    },
                    {
                        id:3,
                        name:'SpringBoot零基础',
                        author:'bb涛'
                    }
                ]
            }
        },
        created() {
            const _this = this
            axios.get('http://localhost:8181/book/findAll').then(function(resp){
                /*_this.tableData = resp.data.data*/
                _this.books=resp.data
            })
        }
    }
</script>

<style scoped>

</style>